<template>
  <div class="tooltip" style="display: inline">
    <el-popover
      placement="top"
      trigger="hover"
      v-model="visible">
      <p v-for="(item, index) in messages" :key="index">{{ item }}</p>
      <i slot="reference" class="iconfont el-third-iconwenhao" style="margin-left:2px;"></i>

    </el-popover>
    <span style="position:absolute;margin-top: 3px">
     <i slot="reference" v-if="!isshowtrue" class="el-icon-plus" @click="childMethod()" style="margin-left:50px;color: red"/>
      <i slot="reference" v-if="isshowtrue" class="el-icon-minus" @click="childMethod()" style="margin-left:50px;color: red"/>
    </span>

  </div>
</template>

<script>
import '@/assets/myicon/iconfont.css'
export default {
  name: 'addbutton',
  props: {
    messages: {
      type: Array,
      default: () => []
    },
    isshowtrue: true,
  },
  data() {
    return {}
  },
  methods: {
    childMethod() {
      console.log("bu")
      this.$parent.$parent.$parent.$parent.$parent.fatherMethod();
    }

  }
}
</script>

<style lang="scss" scope>
.tooltip {
  display: inline-block;
  vertical-align: middle;
}
</style>


